#pragma once
#include "BasePlayer.h"
#include "StateMachine.h"

/*
	GoalKeeper.
	A base player with a FSM for his behaviors, it should be part of a team.
*/

class GoalKeeper : public BasePlayer
{
public:
	GoalKeeper(GameState* game, Team* team, int homeRegionId, sf::Color drawColor);
	~GoalKeeper();

	void							Update(const sf::Input& input);
	void							OnDraw(sf::RenderWindow&);
	bool							HandleMessage(const Telegram& msg) { return m_FSM->HandleMessage(msg);}
	
	void							ToHome();
	Vector2							FindShot(){ return Vector2::ZERO; }
	BasePlayer* const				FindPass();

	void							CalculateInterposeWeight();
	
	void							SetUserControl(bool controlled);
	StateMachine<GoalKeeper>* const	GetFSM()const{ return m_FSM; }

private:
	StateMachine<GoalKeeper>*	m_FSM;
};
